package com.health.inquiry.server.controller;

import com.health.common.core.web.controller.BaseController;
import com.health.common.core.web.domain.AjaxResult;
import com.health.common.core.web.page.TableDataInfo;
import com.health.inquiry.common.domain.DmsFans;
import com.health.inquiry.common.domain.vo.DmsFansVo;
import com.health.inquiry.server.service.FansService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 我的粉丝管理
 */
@RestController
@RequestMapping("/fans")
public class FansController extends BaseController {

    @Autowired
    private FansService fansService;

    @GetMapping("/list")
    public TableDataInfo list()
    {
        startPage();
        List<DmsFansVo> dmsFansVos = fansService.selectFansList();
        return getDataTable(dmsFansVos);
    }

    /**
     * 患者关注医生
     */
    @RequestMapping("/addFans")
    public AjaxResult addFans(DmsFans dmsFans)
    {
        fansService.addFans(dmsFans);
        return success();
    }

}
